<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:t="http://myfaces.apache.org/tomahawk"
	xmlns:v="http://corejsf.com/validator">

<f:view>
	<f:loadBundle var="text" basename="#{userList.bundleName}" />
	<head>
		<title>#{text['menu.product.category.edit.title']}</title>
		<meta name="heading" content="#{text['menu.product.category.edit.title']}" />
		<meta name="menu" content="AdminMenu" />
	</head>
	<body id="editProductCategory">
		<h:form id="editProductCategory" enctype="multipart/form-data">
		<h:inputHidden value="#{productCategoryForm.productCategory.id}" id="id"/>
			<h:panelGrid>
				
				<h:outputLabel for="productCategoryName" value="#{text['menu.product.category.name']}"/>
					<t:message for="productCategoryName" errorStyle="color:red"/>
					<h:inputText requiredMessage="'Category name' is required field" value="#{productCategoryForm.productCategory.name}" id="productCategoryName" required="true" styleClass="text large">
						<v:commonsValidator type="required"></v:commonsValidator>
					</h:inputText>
					
					<h:outputLabel styleClass="desc" for="currentImage" value="#{text['menu.product.category.edit.image.old']}"/>
					<t:graphicImage id="current" url="/resource/image/${productCategoryForm.productCategory.image.URI}"></t:graphicImage>
					
					
					<h:outputLabel styleClass="desc" for="file" value="#{text['menu.product.category.edit.image.new']}"/>
    				<t:message for="file" styleClass="fieldError"/>
    				<t:inputFileUpload id="file" value="#{productCategoryForm.file}" storage="file" required="false" styleClass="file medium"/>   				
    				        				
				
				<h:panelGroup styleClass="buttonBar bottom">
        			<h:commandButton value="#{text['button.add']}" action="#{productCategoryForm.editProductCategory}" id="saveProductCategory" styleClass="button"/>
    			<h:commandButton value="#{text['button.cancel']}" action="#{productCategoryForm.cancel}" immediate="true"
            		styleClass="button" onclick="bCancel=true"/>
    			</h:panelGroup>
			</h:panelGrid>			
		</h:form>
	</body>
</f:view>
</html>
